3.40 \(\int \cos (a+\frac{b}{x^2}) \, dx\)

Optimal. Leaf size=79 \[ \sqrt{2 \pi } \sqrt{b} \sin (a) \text{FresnelC}\left (\frac{\sqrt{\frac{2}{\pi }} \sqrt{b}}{x}\right )+\sqrt{2 \pi } \sqrt{b} \cos (a) S\left (\frac{\sqrt{b} \sqrt{\frac{2}{\pi }}}{x}\right )+x \cos \left (a+\frac{b}{x^2}\right ) \]

[Out]

x*Cos[a + b/x^2] + Sqrt[b]*Sqrt[2*Pi]*Cos[a]*FresnelS[(Sqrt[b]*Sqrt[2/Pi])/x] + Sqrt[b]*Sqrt[2*Pi]*FresnelC[(S
qrt[b]*Sqrt[2/Pi])/x]*Sin[a]

________________________________________________________________________________________

Rubi [A]  time = 0.0495695, antiderivative size = 79, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 8, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.625, Rules used = {3360, 3388, 3353, 3352, 3351} \[ \sqrt{2 \pi } \sqrt{b} \sin (a) \text{FresnelC}\left (\frac{\sqrt{\frac{2}{\pi }} \sqrt{b}}{x}\right )+\sqrt{2 \pi } \sqrt{b} \cos (a) S\left (\frac{\sqrt{b} \sqrt{\frac{2}{\pi }}}{x}\right )+x \cos \left (a+\frac{b}{x^2}\right ) \]

Antiderivative was successfully verified.

[In]

Int[Cos[a + b/x^2],x]

[Out]

x*Cos[a + b/x^2] + Sqrt[b]*Sqrt[2*Pi]*Cos[a]*FresnelS[(Sqrt[b]*Sqrt[2/Pi])/x] + Sqrt[b]*Sqrt[2*Pi]*FresnelC[(S
qrt[b]*Sqrt[2/Pi])/x]*Sin[a]

Rule 3360

Int[((a_.) + Cos[(c_.) + (d_.)*((e_.) + (f_.)*(x_))^(n_)]*(b_.))^(p_.), x_Symbol] :> -Dist[f^(-1), Subst[Int[(
a + b*Cos[c + d/x^n])^p/x^2, x], x, 1/(e + f*x)], x] /; FreeQ[{a, b, c, d, e, f}, x] && IGtQ[p, 0] && ILtQ[n,
0] && EqQ[n, -2]

Rule 3388

Int[Cos[(c_.) + (d_.)*(x_)^(n_)]*((e_.)*(x_))^(m_), x_Symbol] :> Simp[((e*x)^(m + 1)*Cos[c + d*x^n])/(e*(m + 1
)), x] + Dist[(d*n)/(e^n*(m + 1)), Int[(e*x)^(m + n)*Sin[c + d*x^n], x], x] /; FreeQ[{c, d, e}, x] && IGtQ[n,
0] && LtQ[m, -1]

Rule 3353

Int[Sin[(c_) + (d_.)*((e_.) + (f_.)*(x_))^2], x_Symbol] :> Dist[Sin[c], Int[Cos[d*(e + f*x)^2], x], x] + Dist[
Cos[c], Int[Sin[d*(e + f*x)^2], x], x] /; FreeQ[{c, d, e, f}, x]

Rule 3352

Int[Cos[(d_.)*((e_.) + (f_.)*(x_))^2], x_Symbol] :> Simp[(Sqrt[Pi/2]*FresnelC[Sqrt[2/Pi]*Rt[d, 2]*(e + f*x)])/
(f*Rt[d, 2]), x] /; FreeQ[{d, e, f}, x]

Rule 3351

Int[Sin[(d_.)*((e_.) + (f_.)*(x_))^2], x_Symbol] :> Simp[(Sqrt[Pi/2]*FresnelS[Sqrt[2/Pi]*Rt[d, 2]*(e + f*x)])/
(f*Rt[d, 2]), x] /; FreeQ[{d, e, f}, x]

Rubi steps

\begin{align*} \int \cos \left (a+\frac{b}{x^2}\right ) \, dx &=-\operatorname{Subst}\left (\int \frac{\cos \left (a+b x^2\right )}{x^2} \, dx,x,\frac{1}{x}\right )\\ &=x \cos \left (a+\frac{b}{x^2}\right )+(2 b) \operatorname{Subst}\left (\int \sin \left (a+b x^2\right ) \, dx,x,\frac{1}{x}\right )\\ &=x \cos \left (a+\frac{b}{x^2}\right )+(2 b \cos (a)) \operatorname{Subst}\left (\int \sin \left (b x^2\right ) \, dx,x,\frac{1}{x}\right )+(2 b \sin (a)) \operatorname{Subst}\left (\int \cos \left (b x^2\right ) \, dx,x,\frac{1}{x}\right )\\ &=x \cos \left (a+\frac{b}{x^2}\right )+\sqrt{b} \sqrt{2 \pi } \cos (a) S\left (\frac{\sqrt{b} \sqrt{\frac{2}{\pi }}}{x}\right )+\sqrt{b} \sqrt{2 \pi } C\left (\frac{\sqrt{b} \sqrt{\frac{2}{\pi }}}{x}\right ) \sin (a)\\ \end{align*}

Mathematica [A]  time = 0.133651, size = 80, normalized size = 1.01 \[ \sqrt{2 \pi } \sqrt{b} \left (\sin (a) \text{FresnelC}\left (\frac{\sqrt{\frac{2}{\pi }} \sqrt{b}}{x}\right )+\cos (a) S\left (\frac{\sqrt{b} \sqrt{\frac{2}{\pi }}}{x}\right )\right )-x \sin (a) \sin \left (\frac{b}{x^2}\right )+x \cos (a) \cos \left (\frac{b}{x^2}\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[a + b/x^2],x]

[Out]

x*Cos[a]*Cos[b/x^2] + Sqrt[b]*Sqrt[2*Pi]*(Cos[a]*FresnelS[(Sqrt[b]*Sqrt[2/Pi])/x] + FresnelC[(Sqrt[b]*Sqrt[2/P
i])/x]*Sin[a]) - x*Sin[a]*Sin[b/x^2]

________________________________________________________________________________________

Maple [A]  time = 0.033, size = 57, normalized size = 0.7 \begin{align*} x\cos \left ( a+{\frac{b}{{x}^{2}}} \right ) +\sqrt{b}\sqrt{2}\sqrt{\pi } \left ( \cos \left ( a \right ){\it FresnelS} \left ({\frac{\sqrt{2}}{\sqrt{\pi }x}\sqrt{b}} \right ) +\sin \left ( a \right ){\it FresnelC} \left ({\frac{\sqrt{2}}{\sqrt{\pi }x}\sqrt{b}} \right ) \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(a+b/x^2),x)

[Out]

x*cos(a+b/x^2)+b^(1/2)*2^(1/2)*Pi^(1/2)*(cos(a)*FresnelS(b^(1/2)*2^(1/2)/Pi^(1/2)/x)+sin(a)*FresnelC(b^(1/2)*2
^(1/2)/Pi^(1/2)/x))

________________________________________________________________________________________

Maxima [C]  time = 1.41774, size = 533, normalized size = 6.75 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(a+b/x^2),x, algorithm="maxima")

[Out]

1/4*(4*x^2*sqrt(abs(b)/x^2)*cos((a*x^2 + b)/x^2) + (((I*sqrt(pi)*(erf(sqrt(I*b/x^2)) - 1) - I*sqrt(pi)*(erf(sq
rt(-I*b/x^2)) - 1))*cos(1/4*pi + 1/2*arctan2(0, b)) + (I*sqrt(pi)*(erf(sqrt(I*b/x^2)) - 1) - I*sqrt(pi)*(erf(s
qrt(-I*b/x^2)) - 1))*cos(-1/4*pi + 1/2*arctan2(0, b)) + (sqrt(pi)*(erf(sqrt(I*b/x^2)) - 1) + sqrt(pi)*(erf(sqr
t(-I*b/x^2)) - 1))*sin(1/4*pi + 1/2*arctan2(0, b)) - (sqrt(pi)*(erf(sqrt(I*b/x^2)) - 1) + sqrt(pi)*(erf(sqrt(-
I*b/x^2)) - 1))*sin(-1/4*pi + 1/2*arctan2(0, b)))*cos(a) + ((sqrt(pi)*(erf(sqrt(I*b/x^2)) - 1) + sqrt(pi)*(erf
(sqrt(-I*b/x^2)) - 1))*cos(1/4*pi + 1/2*arctan2(0, b)) + (sqrt(pi)*(erf(sqrt(I*b/x^2)) - 1) + sqrt(pi)*(erf(sq
rt(-I*b/x^2)) - 1))*cos(-1/4*pi + 1/2*arctan2(0, b)) + (-I*sqrt(pi)*(erf(sqrt(I*b/x^2)) - 1) + I*sqrt(pi)*(erf
(sqrt(-I*b/x^2)) - 1))*sin(1/4*pi + 1/2*arctan2(0, b)) + (I*sqrt(pi)*(erf(sqrt(I*b/x^2)) - 1) - I*sqrt(pi)*(er
f(sqrt(-I*b/x^2)) - 1))*sin(-1/4*pi + 1/2*arctan2(0, b)))*sin(a))*b)/(x*sqrt(abs(b)/x^2))

________________________________________________________________________________________

Fricas [A]  time = 1.68905, size = 208, normalized size = 2.63 \begin{align*} \sqrt{2} \pi \sqrt{\frac{b}{\pi }} \cos \left (a\right ) \operatorname{S}\left (\frac{\sqrt{2} \sqrt{\frac{b}{\pi }}}{x}\right ) + \sqrt{2} \pi \sqrt{\frac{b}{\pi }} \operatorname{C}\left (\frac{\sqrt{2} \sqrt{\frac{b}{\pi }}}{x}\right ) \sin \left (a\right ) + x \cos \left (\frac{a x^{2} + b}{x^{2}}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(a+b/x^2),x, algorithm="fricas")

[Out]

sqrt(2)*pi*sqrt(b/pi)*cos(a)*fresnel_sin(sqrt(2)*sqrt(b/pi)/x) + sqrt(2)*pi*sqrt(b/pi)*fresnel_cos(sqrt(2)*sqr
t(b/pi)/x)*sin(a) + x*cos((a*x^2 + b)/x^2)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \cos{\left (a + \frac{b}{x^{2}} \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(a+b/x**2),x)

[Out]

Integral(cos(a + b/x**2), x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \cos \left (a + \frac{b}{x^{2}}\right )\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(a+b/x^2),x, algorithm="giac")

[Out]

integrate(cos(a + b/x^2), x)